package testView;

import static org.junit.Assert.*;

import org.junit.Test;


import static org.junit.Assert.assertEquals;

import model.ClassImpl;
import model.RelationshipImpl;



public class relationshipTest
{
	
	
	@Test
	public void test(){
	//Declare test variables.	
		int test1 = 10;
		int test2= 15;
		int test3 = 12;
		int test4= 14;
	
	ClassImpl testSrc = new ClassImpl("Test 1");
	ClassImpl testDest = new ClassImpl("Test 2");
	
	//Test constructor
	RelationshipImpl testRel = new RelationshipImpl(testSrc, testDest);
	
	
	assertEquals(testRel.getSrc(), testSrc);
	assertEquals(testRel.getDest(), testDest);
	
	//Test setters and getters for multiplicity
	testRel.setDestMax(test2);
	testRel.setDestMin(test1);
	
	testRel.setSrcMax(test4);
	testRel.setSrcMin(test3);
	
	assertEquals(testRel.getDestMax(),test2);
	assertEquals(testRel.getDestMin(),test1);
	
	assertEquals(testRel.getSrcMax(),test4);
	assertEquals(testRel.getSrcMin(),test3);
	
	//Create new test Classes
	ClassImpl testSrc1 = new ClassImpl("Test 3");
	ClassImpl testDest1 = new ClassImpl("Test 4");
	
	//Test setter and getter for src and dest
	testRel.setDest(testDest1);
	testRel.setSrc(testSrc1);
	
	assertEquals(testRel.getSrc(), testSrc1);
	assertEquals(testRel.getDest(), testDest1);
	
	
	
	
	}
	
}
